<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            background-color:blue;
            width: 1000px;
            height: 500px;
        }
        .aa{
           background-color: red;
            width: 50px;
            height:50px;
            position: relative;
            animation: weiyi 5s linear 0s infinite alternate;
        }   
        @keyframes weiyi{
           0%{left: 0;top: 0;}
           50%{left: 100%;top: 50%;}
           100%{left: 0;top: 100%;}
        }
    </style>
</head>
<body>
    <div class="aa"></div>
    
</body>
<html>
